# Usage

To start:

```sh
./start.sh
```

Make sure you have the OAuth2 application's **Redirect URL** set to the suggested one in the output. This is basically the URL to access Drone CI. Go to the URL, click Sync and activate the repo you want to enable Drone for.

Commit a `.drone.yml` in that repo with something like:

```yaml
kind: pipeline
type: docker
name: default

steps:
- name: greeting
  image: alpine
  commands:
  - echo hello
  - echo world
```

After you make the commit, open the Drone UI, go to the repo and see status of the build process. The build should automatically run after each commit.

To stop:

```sh
./stop.sh
```


## Troubleshooting

### My data is lost, previous builds are gone!

Until v0.2 the `database.sqlite` file was stored in repo root. This caused an issue if you changed the repo provider ever down the line.

e.g. If you use Gitea, then switch to Gogs, then back to Gitea, it will show you the Gogs builds and repos. This is because it messes up the Drone CI database file.

As a fix since 0.2.1, a separate `data` directory is introduced and a directory for the repo host is created inside it when you start Droney. That directory is then used as the data directory to store the `database.sqlite` file. So now it is possible to use multiple repo providers without getting their data mixed together.

When starting, make sure to choose `y` when asked to move the database file. If you were asked and you selected `n` before, delete the database file inside `data/(repo host)` directory (or rename as `database.sqlite.bak`) and start again, then choose `y` when asked. This should automatically move your old database file in the new place.
